package business;

import java.util.ArrayList;
import java.util.Calendar;

import dto.DTOAbsence;
import dto.DTOClass;
import dto.DTOCompany;
import dto.DTOContact;
import dto.DTORelation;


/**
 * @author Jonathan Maret
 * The interface for the business layer
 */
public interface BusinessService {

	/**
	 * @return All contacts
	 */
	public ArrayList<DTOContact> getAllContact();
	/**
	 * @return All students
	 */
	public ArrayList<DTOContact> getAllStudent();
	/**
	 * @param clasS 
	 * @return All students without a relation to the specified class
	 */
	public ArrayList<DTOContact> getAllStudentAvailable(DTOClass clasS);
	/**
	 * @return All teachers
	 */
	public ArrayList<DTOContact> getAllTeacher();
	/**
	 * @param clasS
	 * @return All teachers without a relation to the specified class
	 */
	public ArrayList<DTOContact> getAllTeacherAvailable(DTOClass clasS);
	/**
	 * @param visa
	 * @return The contact corresponding to the visa
	 */
	public DTOContact getContactByVisa(String visa);
	/**
	 * @param id
	 * @return The contact corresponding to the id
	 */
	public DTOContact getContactById(int id);
	/**
	 * @return All classes
	 */
	public ArrayList<DTOClass> getAllClass();	
	/**
	 * @param name
	 * @return The class with the corresponding name
	 */
	public DTOClass getClassByName(String name);		
	/**
	 * @param id
	 * @return The class with the corresponding id
	 */
	public DTOClass getClassById(int id);
	/**
	 * @param clasS
	 * @return All contacts corresponding to a class
	 */
	public ArrayList<DTOContact> getContactsByClass(DTOClass clasS);
	/**
	 * @param contact
	 * @return All classes corresponding to a contact
	 */
	public ArrayList<DTOClass> getClassByContact(DTOContact contact);
	/**
	 * @param contact
	 * @param clasS
	 * @return The relation corresponding to the contact and the class
	 */
	public DTORelation getRelation(DTOContact contact, DTOClass clasS);
	/**
	 * @param contact
	 * @param calendar
	 * @return The absence corresponding to the contact(if students) and the calendar
	 */
	public DTOAbsence getAbsenceByContactByDate(DTOContact contact, Calendar calendar);
	/**
	 * @param contact
	 * @return Any absence corresponding to a contact
	 */
	public ArrayList<DTOAbsence> getAbsenceByContact(DTOContact contact);
	/**
	 * 	Update an absence
	 * @param clasS
	 * @param contact
	 * @param calendar
	 * @param absence
	 */
	public void updateAbsence(DTOContact contact, Calendar calendar, DTOAbsence absence);
	/**
	 * Update a class
	 * @param clasS
	 * @param holder
	 * @param teacher
	 * @param student
	 */
	public void updateClass(DTOClass clasS,DTOContact holder, ArrayList<DTOContact> teacher,ArrayList<DTOContact> student);
	/**
	 * @param contact
	 * @return Any relation related to a contact
	 */
	public ArrayList<DTORelation> getAllRelationByContact(DTOContact contact);
	/**
	 * @param clasS
	 * @return Any relation related to a class
	 */
	public ArrayList<DTORelation> getAllRelationByClass(DTOClass clasS);

	/**
	 * Remove a class
	 * @param clasS
	 */
	public void removeClass(DTOClass clasS);
	/**
	 * remove a contact
	 * @param contact
	 */
	public void removeContact(DTOContact contact);
	/**
	 * @param clasS
	 * @return The same arraylist sorted by the class name
	 */
	public ArrayList<DTOClass> sortClass(ArrayList<DTOClass> clasS);
	/**
	 * @param contact
	 * @return The same arrayList sorted by the lastname and firstname
	 */
	public ArrayList<DTOContact> sortContact(ArrayList<DTOContact> contact);
	/**
	 * @param contact
	 * @return All class who are not linked to the the specified contact
	 */
	public ArrayList<DTOClass> getAllClassAvailable(DTOContact contact);
	/**
	 * Update a contact
	 * @param contact
	 * @param clasS
	 */
	public void updateContact(DTOContact contact, ArrayList<DTOClass> clasS);
	/**
	 * @return All companies
	 */
	public ArrayList<DTOCompany> getAllCompany();
	/**
	 * @param day
	 * @return Get all absence for a day
	 */
	public ArrayList<DTOAbsence> getDailyAbsence(Calendar day);

}
